﻿<%@ Page Language="C#" MasterPageFile="~/cms/defaultLayout.master" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="cms_default" %>
<%@ MasterType  virtualPath="~/cms/defaultLayout.master"%>
<asp:Content ID="mainContent" ContentPlaceHolderID="main" runat="server">
        <form id="form1" runat="server">
        <div class="content">
          <div class="buttons"><center>
                <a id="A1" class="" runat="server" href="~/cms/film"><asp:Label ID="lblFilm" runat="server"/>[Film]</a> -
                <a id="A2" class="" runat="server" href="~/cms/planning"><asp:Label ID="lblplanning" runat="server" />[Planning]</a> -
                <a id="A3" class="" runat="server" href="~/cms/account"><asp:Label ID="lblAccount" runat="server"/><b>[Account]</b></a> -
                <a id="A4" class="" runat="server" href="~/cms/abonnement"><asp:Label ID="lblAbonnement" runat="server" />[Abonnement]</a> -
                <a id="A5" class="" runat="server" href="~/cms/zaal"><asp:Label ID="lblZaal" runat="server"/>[Zaal]</a> -
                <a id="A6" class="" runat="server" href="~/cms/vestiging"><asp:Label ID="lblVestiging" runat="server" />[Vestiging]</a> -
                <a id="A7" class="" runat="server" href="~/cms/user"><asp:Label ID="lblUser" runat="server"/>[User]</a> - 
               <a id="A8" class="" runat="server" href="~/cms/kaarten"><asp:Label ID="lblKaarten" runat="server"/>[Kaarten]</a>
                </center>
            </div>
            <p>This is "Account" of CMS</p>
            <div class="cms_view" dir="ltr"><br />
                <asp:GridView ID="gvAccount" runat="server" AllowPaging="True" CellPadding="3" DataSourceID="dsSelectAccount" ForeColor="Black" GridLines="Both" DataKeyNames="gebruikersnaam" OnSelectedIndexChanged="gvAccount_SelectedIndexChanged" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px">
                    <AlternatingRowStyle BackColor="#CCCCCC" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" ButtonType="Button" />
                    </Columns>
                    <FooterStyle BackColor="#CCCCCC" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />


                    <EmptyDataTemplate>
                        Er zijn geen klanten gevonden. Hier kunt u een nieuwe klant toevoegen.
                        <table>
                            <tr><td>Voornaam: </td><td>
                                <asp:TextBox ID="tbFirstName" runat="server"></asp:TextBox></td><td>
                                <asp:RegularExpressionValidator ID="revFirstName" ControlToValidate="tbFirstName" runat="server" ErrorMessage="U kunt hier alleen bestaande letters invoeren." ValidationExpression="^([ \u00c0-\u01ffa-zA-Z'])+$"></asp:RegularExpressionValidator></td></tr>
                            <tr><td>Tussenvoegsel: </td><td>
                                <asp:TextBox ID="tbTussenvoegsel" runat="server"></asp:TextBox></td><td>
                                <asp:RegularExpressionValidator ID="revTussenvoegsel" ControlToValidate="tbTussenvoegsel" runat="server" ErrorMessage="U kunt hier alleen bestaande letters invoeren." ValidationExpression="^([ \u00c0-\u01ffa-zA-Z'])+$"></asp:RegularExpressionValidator></td></tr>
                            <tr><td>Achternaam: </td><td>
                                <asp:TextBox ID="tbSurName" runat="server"></asp:TextBox></td><td>
                                <asp:RegularExpressionValidator ID="revSureName" ControlToValidate="tbSurName" runat="server" ErrorMessage="U kunt hier alleen bestaande letters invoeren." ValidationExpression="^([ \u00c0-\u01ffa-zA-Z'])+$"></asp:RegularExpressionValidator></td></tr>
                            <tr><td>Gebruikersnaam: </td><td>
                                <asp:TextBox ID="tbUsername" runat="server" AutoPostBack="true" OnTextChanged="tbUsername_TextChanged"></asp:TextBox></td><td>
                                <asp:Label ID="lblUsername" runat="server" Text=""></asp:Label></td></tr>
                            <tr><td>Wachtwoord: </td><td>
                                <asp:TextBox ID="tbPassword" TextMode="password" runat="server"></asp:TextBox></td><td>
                                <asp:RegularExpressionValidator ID="revPassword" runat="server" ControlToValidate="tbPassword" ErrorMessage="Min 8 karakters, max 12 karakters, min een letter, min een cijfer" ValidationExpression="(?!^[0-9]*$)(?!^[a-zA-Z]*$)(?!^[\w]*$)^([a-zA-Z0-9\w]{7,12})$"></asp:RegularExpressionValidator></td></tr>
                            <tr><td>Herhaal wachtwoord: </td><td>
                                <asp:TextBox ID="tbPassword2" TextMode="password" runat="server"></asp:TextBox></td><td>
                                <asp:CompareValidator ID="cvPassword" runat="server" ErrorMessage="Wachtwoorden moeten overeenkomen." ControlToCompare="tbPassword" ControlToValidate="tbPassword2"></asp:CompareValidator></td></tr>
                            <tr><td>Geboortedatum: </td><td>
                                <asp:TextBox ID="tbDateOfBirth" runat="server"></asp:TextBox></td> <td>
                                <asp:RegularExpressionValidator ID="revDateOfBirth" ControlToValidate="tbDateOfBirth" runat="server" ErrorMessage="Datum heeft de mm/dd/yyyy formaat. Voorbeeld: 12/29/1993." ValidationExpression="^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$"></asp:RegularExpressionValidator>
                            </td></tr>
                            <tr><td>Straatnaam: </td><td>
                                <asp:TextBox ID="tbStreet" runat="server"></asp:TextBox></td><td>
                                <asp:RegularExpressionValidator ID="revStreet" ControlToValidate="tbStreet" runat="server" ErrorMessage="U kunt hier alleen bestaande letters invoeren." ValidationExpression="^([ \u00c0-\u01ffa-zA-Z'])+$"></asp:RegularExpressionValidator></td></tr>
                            <tr><td>Huisnummer: </td><td>
                                <asp:TextBox ID="tbStreetNumber" runat="server"></asp:TextBox></td></tr>
                            <tr><td>Postcode: </td><td>
                                <asp:TextBox ID="tbPostal" runat="server"></asp:TextBox></td><td>
                                <asp:RegularExpressionValidator ID="revPostal" ControlToValidate="tbPostal" runat="server" ErrorMessage="Voer een geldige postcode in ####(a-Z)(a-Z). Voorbeeld: 1234YZ" ValidationExpression="^[1-9][0-9]{3}[a-zA-Z]{2}$"></asp:RegularExpressionValidator></td></tr>
                            <tr><td>Geslacht: </td><td> 
                                <asp:DropDownList ID="ddlSex" runat="server">
                                    <asp:ListItem>m</asp:ListItem>
                                    <asp:ListItem>v</asp:ListItem>
                                </asp:DropDownList> </td></tr>
                            <tr><td>Taal: </td><td> <asp:DropDownList ID="ddlLanguage" runat="server" DataSourceID="dsLanguage" DataTextField="naam" DataValueField="naam"></asp:DropDownList> </td></tr>
                            <tr><td>Nieuwsbrief: </td><td> 
                                <asp:DropDownList ID="ddlNewsletter" runat="server">
                                    <asp:ListItem>ja</asp:ListItem>
                                    <asp:ListItem>nee</asp:ListItem>
                                </asp:DropDownList></td></tr>
                            <tr><td>Abonnement: </td><td> <asp:DropDownList ID="ddlSubscription" runat="server" DataSourceID="dsSubscription" DataTextField="abbonementnaam" DataValueField="abbonementnaam"></asp:DropDownList> </td></tr>
                        </table>
                        <asp:Button ID="btnAdd" runat="server" Text="Toevoegen" OnClick="btnAdd_Click" />
                    </EmptyDataTemplate>


                </asp:GridView>


                <br />
                <hr />
                <br />

                <%--DataSourceID="dsDetailAccount"--%>
                <asp:DetailsView OnItemDeleted="dvAccount_ItemDeleted" OnPreRender="dvAccount_PreRender" DataSourceID="dsDetailAccount" ID="dvAccount" runat="server" CellPadding="4" ForeColor="#333333" GridLines="Horizontal">
                    <AlternatingRowStyle BackColor="White" />
                    <CommandRowStyle BackColor="#C5BBAF" Font-Bold="True" />
                    <EditRowStyle BackColor="#7C6F57" />
                    <InsertRowStyle BackColor="#669999" />
                    <FieldHeaderStyle BackColor="#D0D0D0" Font-Bold="True" />
                    <Fields>
                        <asp:CommandField ButtonType="Button" ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
                    </Fields>
                    <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#E3EAEB" />
                </asp:DetailsView>
            </div>


            <asp:EntityDataSource OrderBy="it.gebruikersnaam" ID="dsSelectAccount" runat="server" ConnectionString="name=debioscoopEntities" DefaultContainerName="debioscoopEntities" EnableFlattening="False" EntitySetName="accounts" EntityTypeFilter="account" Select="it.[gebruikersnaam]"></asp:EntityDataSource>
            <asp:EntityDataSource ID="dsDetailAccount" runat="server" ConnectionString="name=debioscoopEntities" DefaultContainerName="debioscoopEntities" EnableFlattening="False" EntitySetName="accounts" EntityTypeFilter="account" Where="it.gebruikersnaam = @selGebruikersnaam" EnableDelete="True" EnableInsert="True" EnableUpdate="True">
                <WhereParameters>
	                <asp:ControlParameter ControlID="gvAccount" Name="selGebruikersnaam" DbType="String" PropertyName="SelectedValue" />
	            </WhereParameters>
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="dsLanguage" runat="server" ConnectionString="name=debioscoopEntities" DefaultContainerName="debioscoopEntities" EnableFlattening="False" EntitySetName="languages" EntityTypeFilter="language" Select="it.[taalid], it.[naam]">
            </asp:EntityDataSource>
            <asp:EntityDataSource ID="dsSubscription" runat="server" ConnectionString="name=debioscoopEntities" DefaultContainerName="debioscoopEntities" EnableFlattening="False" EntitySetName="abbonements" Select="it.[abbonementnaam]">
            </asp:EntityDataSource>
        </div>
        </form>
</asp:Content>
